-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typesafe Splipy, again #175
Open
TheBB
wants to merge
29
commits into
SINTEF:master
Choose a base branch
from
TheBB:typesafe-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 type errors still to go (out of about 500) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR does the following:
When this is merged, CI fill fail if:
I have written a nice Makefile that helps developers out, and I've written how to use it in the readme. In particular,
make lint
andmake format
will automatically fix as many issues with the 3rd and 4th failure modes as possible. There are some it can't fix, and type and test failures will need to fixed manually.The CI is configured to NEVER fix anything automatically - it will just check.
The following should be noted. The way I see it this addresses all the issues in #174.
BSplineBases.evaluate
returns either a sparse or a dense array. There are now two new methods,evalute_sparse
andevaluate_dense
. Theevaluate
method still exists.SplineObject.split
returns a SplineObject or a list of SplineObjects based on information that can't be detected in types (it returns a single spline if the spline is periodic and is being split at only one point). This is the most serious one. I have addedspit_periodic
which takes a single knot and requires that the spline be periodic - it returns a single new spline that isn't periodic. I have also addedsplit_nonperiodic
which takes one or more knots, requires that the spline be non-periodic and always returns a list. I have also addedsplit_many
which has the same requirements assplit
does but which always returns a list, even in the periodic single-knot case. The methodsplit
remains in place as before.Curve.curvature
andCurve.torsion
used to not obey the Splipy convention that evaluation functions return a single output if given a scalar, and should return an array of outputs if given a list of inputs, even if that input is a list with only one element. This has been fixed.splipy.utils.bisect
. This is a pure copy of Python's bisect module from Python 3.10 that we can remove for good when we drop support for Python 3.9.splipy.io.grdecl
. I tried, but this code is pretty rough, and at this point unlikely to see serious use for a while.This is strictly speaking ready to merge but let's leave it for a little while so my brain can sleep on it. I don't expect anyone to literally read all the changes - many of them are automatized lint-checks, but a cursory glance might be good.